import request from '@/utils/request';

/**
 * 根据公司或部门查询公司所有员工（不包含子公司） [DELETE]
 * @param {integer} companyId 公司id
 */
// export function getemployeebycondition(params) {
//     return request('/api/uc/org/employee/v1/employee/simple/info/list', {
//         method: 'POST',
//         data: params
//     });
// }

/**
 * 员工假期余额列表-分页
 */
export function fetchVacationList(params) {
    return request('/api/oa/v1/vocation/getlist', {
        method: 'POST',
        data: params
    });
}

/**
 * 假期余额列表接口-搜索列集合
 */
export function getColumnlist(params) {
    return request(`/api/work/v1/attendance/leavetype/typelist/${params.companyId}`, {
        method: 'POST'
    });
}

/**
 * 获取公司列表
 */
export function getModalCompany(params) {
    return request('/api/org/v1/functional/list', {
        method: 'POST',
        data: params
    });
}

/**
 * 下载员工假期余额模板
 */
export function downTemplate() {
    return request('/api/oa/v1/stream/vocation/downtemplate_v2', {
        method: 'GET',
        getResponse: true,
        encryption: false,
        isFile: true,
        responseType: 'blob'
    });
}

/**
 * 根据假期类型显示对应余额
 */
export function getPopoverList(params) {
    return request('/api/work/v1/attendance/vocation/getvocationbalancebyemployeeid', {
        method: 'POST',
        data: params
    });
}

/**
 * 导出员工假期余额
 */
export function getExportlist(params) {
    return request('/api/oa/v1/stream/vocation/exportlist', {
        method: 'POST',
        data: params,
        getResponse: true,
        encryption: false,
        isFile: true,
        responseType: 'blob',
        headers: { 'Content-Type': 'application/json' }
    });
}

/**
 * 修改假期余额
 */
export function updatevocationbalance(params) {
    return request('/api/work/v1/attendance/vocation/updatevocationbalance', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取modal里的假期类型
 */
export function getModalColumnlist(params) {
    return request('/api/work/v1/attendance/leavetype/leavetypelistbycondition', {
        method: 'POST',
        data: params
    });
}
